package com.itheima.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.Date;

@Mapper
public interface MemberDao {


    @Select("select id from t_member where idCard = #{idCard}")
    Long findMemberIdByIdCard(String idCard);

    @Select("select count(*) from t_member where regTime like CONCAT(#{month}, '%')")
    Integer getMemberCountByMonth(String month);

    @Select("select count(*) from t_member where regTime = #{reportData}")
    Integer findNewMemberCountByDate(String reportData);

    @Select("select count(*) from t_member where regTime >= #{start} and regTime <= #{end}")
    Integer getMemberCountByWeek(Date start, Date end);

    @Select("select count(*) from t_member")
    Integer getTotalMember();
}
